<?php 
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../DAO/OrderdetailsDAO.php';
class OrderdetailsService
{
	public function create(BaseContext $context, ServiceResult $result, OrderdetailsDomain $orderdetailsDomain)
	{
		try
		{
			$orderdetailsDAO = new OrderdetailsDAO($context);
			$orderdetailsDAO->create($orderdetailsDomain);
			$result->setSuccess();
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function update(BaseContext $context, ServiceResult $result, OrderdetailsDomain $orderdetailsDomain)
	{
		try
		{
			$orderdetailsDAO = new OrderdetailsDAO($context);
			$orderdetailsDAO->update($orderdetailsDomain);
			$result->setSuccess();
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function delete(BaseContext $context, ServiceResult $result, $oid)
	{
		try
		{
			$orderdetailsDAO = new OrderdetailsDAO($context);
			$orderdetailsDAO->delete($oid);
			$result->setSuccess();
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function findByOid(BaseContext $context, ServiceResult $result, $oid)
	{
		try
		{
			$orderdetailsDAO = new OrderdetailsDAO($context);
			$orderdetailsDomain = $orderdetailsDAO->findByOid($oid);
			$result->setSuccess();
			return $orderdetailsDomain;
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

	public function findAll(BaseContext $context, ServiceResult $result)
	{
		try
		{
			$orderdetailsDAO = new OrderdetailsDAO($context);
			$orderdetailsDomainArr = $orderdetailsDAO->findAll();
			$result->setSuccess();
			return $orderdetailsDomainArr;
		}
		catch (Exception $e)
		{
			$context->logException($e);
			$result->setException($e);
		}
	}

}
?>